#ifndef __VARIANT_H__
#define __VARIANT_H__

#ifdef __cplusplus
extern "C"
{
#endif // __cplusplus

#define PA0     A0
#define PA1     A1
#define PA2     A2
#define PA3     A3
#define PA4     A4
#define PA5     A5
#define PA6     A6
#define PA7     A7
#define PA8     8
#define PA9     9
#define PA10    10
#define PA11    11
#define PA12    12
#define PA13    13
#define PA14    14
#define PA15    15

#define PB0     A8      
#define PB1     A9      
#define PB2     18      
#define PB3     19     
#define PB4     20      
#define PB5     21      
#define PB6     22      
#define PB7     23      
#define PB8     24      
#define PB9     25      
#define PB10    26      
#define PB11    27      
#define PB12    28      
#define PB13    29      
#define PB14    30      
#define PB15    31      

#define PC13    32      
#define PC14    33      
#define PC15    34    

#define PD0     35     
#define PD1     36      

// Alternate pins number
#define PA0_ALT1                (PA0  | ALT1)
#define PA1_ALT1                (PA1  | ALT1)
#define PA2_ALT1                (PA2  | ALT1)
#define PA3_ALT1                (PA3  | ALT1)
#define PA4_ALT1                (PA4  | ALT1)
#define PA5_ALT1                (PA5  | ALT1)
#define PA6_ALT1                (PA6  | ALT1)
#define PA7_ALT1                (PA7  | ALT1)
#define PA8_ALT1                (PA8  | ALT1)
#define PA9_ALT1                (PA9  | ALT1)
#define PA10_ALT1               (PA10 | ALT1)
#define PA11_ALT1               (PA11 | ALT1)
#define PA15_ALT1               (PA15 | ALT1)
#define PB0_ALT1                (PB0  | ALT1)
#define PB0_ALT2                (PB0  | ALT2)
#define PB1_ALT1                (PB1  | ALT1)
#define PB1_ALT2                (PB1  | ALT2)
#define PB3_ALT1                (PB3  | ALT1)
#define PB10_ALT1               (PB10 | ALT1)
#define PB11_ALT1               (PB11 | ALT1)
#define PB13_ALT1               (PB13 | ALT1)
#define PB14_ALT1               (PB14 | ALT1)

// This must be a literal
#define NUM_DIGITAL_PINS        37
#define NUM_ANALOG_INPUTS       10

#ifndef LED_BUILTIN
#define LED_BUILTIN             PC13
#endif
#define LED_GREEN               LED_BUILTIN

// SPI Definitions
#define PIN_SPI_SS              PA4
#define PIN_SPI_MOSI            PA7
#define PIN_SPI_MISO            PA6
#define PIN_SPI_SCK             PA5


// I2C Definitions
#define PIN_WIRE_SDA            PB9
#define PIN_WIRE_SCL            PB8

#define TIMER_TONE              TIM3
#define TIMER_SERVO             TIM2

#define SERIAL_UART_INSTANCE    1

#ifdef __cplusplus
} // extern "C"
#endif

#ifdef __cplusplus
 #ifndef SERIAL_PORT_MONITOR
    #define SERIAL_PORT_MONITOR   Serial
  #endif
  #ifndef SERIAL_PORT_HARDWARE
    #define SERIAL_PORT_HARDWARE  Serial
  #endif
#endif

#endif // __VARIANT_H__